//
//  JdlotCollectionCell.m
//  PlayBall
//
//  Created by wangqian on 2017/3/16.
//
//

#import "JdlotCollectionCell.h"
#import "Masonry.h"



@interface JdlotCollectionCell ()

@property(nonatomic,strong)UIImageView *imageview;
@property(nonatomic,strong)UILabel *titlelabel;
@property(nonatomic,strong)UILabel *line1;
@property(nonatomic,strong)UILabel *line2;


@end
@implementation JdlotCollectionCell

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageview = [[UIImageView alloc]init];
        [self.contentView addSubview:self.imageview];
        
        self.titlelabel = [[UILabel alloc] init];
        self.titlelabel.text = @"";
        self.titlelabel.textAlignment = NSTextAlignmentCenter;
        self.titlelabel.font = [UIFont systemFontOfSize:12];
        self.titlelabel.textColor = UIColorFromRGB(0x222222);
        [self.contentView addSubview:self.titlelabel];
        
        self.line1 = [[UILabel alloc] init];
        self.line1.backgroundColor = UIColorFromRGB(0xd8d8d6);
        [self.contentView addSubview:self.line1];
        
        self.line2 = [[UILabel alloc] init];
        self.line2.backgroundColor = UIColorFromRGB(0xd8d8d6);
        [self.contentView addSubview:self.line2];
        
        [self layout];
    }
    return self;
}

- (void)layout
{
    [self.imageview mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).with.offset(10);
        make.centerX.equalTo(self.contentView).with.offset(0);
        make.size.mas_equalTo(CGSizeMake(30, 30));
    }];
    
    
    [self.titlelabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.imageview.mas_bottom).with.offset(10);
        make.centerX.equalTo(self.imageview).with.offset(0);
        make.size.mas_equalTo(CGSizeMake(50, 20));
    }];
    
    
    [self.line1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).with.offset(0);
        make.size.mas_equalTo(CGSizeMake(0.5, 80));
    }];

    [self.line2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.contentView).with.offset(0);
        make.size.mas_equalTo(CGSizeMake(SCREEN_WIDTH/3, 0.5));
    }];
}

- (void)number:(int)cnumber
{
    switch (cnumber) {
        case 5:
        {
            self.imageview.image = [UIImage imageNamed:@"7"];
            self.titlelabel.text = @"双色球";
        }
            break;
        case 70:
        {
            self.imageview.image = [UIImage imageNamed:@"4"];
            self.titlelabel.text = @"11选5";
        }
            break;
        case 6:
        {
            self.imageview.image = [UIImage imageNamed:@"5"];
            self.titlelabel.text = @"福彩3D";
        }
            break;
        case 13:
        {
            self.imageview.image = [UIImage imageNamed:@"9"];
            self.titlelabel.text = @"7乐彩";
        }
            break;
        case 28:
        {
            self.imageview.image = [UIImage imageNamed:@"6"];
            self.titlelabel.text = @"时时彩";
        }
            break;
        case 62:
        {
            self.imageview.image = [UIImage imageNamed:@"211"];
            self.titlelabel.text = @"11运夺金";
        }
            break;
        case 39:
        {
            self.imageview.image = [UIImage imageNamed:@"8"];
            self.titlelabel.text = @"大乐透";
        }
            break;
        case 90:
        {
            self.imageview.image = [UIImage imageNamed:@"jc1"];
            self.titlelabel.text = @"竞彩足球";
        }
            break;
        case 45:
        {
            self.imageview.image = [UIImage imageNamed:@"danchang"];
            self.titlelabel.text = @"北京单场";
        }
            break;
        case 91:
        {
            self.imageview.image = [UIImage imageNamed:@"lanqiu"];
            self.titlelabel.text = @"竞彩篮球";
        }
            break;
        case 1:
        {
            self.imageview.image = [UIImage imageNamed:@"shengfucai"];
            self.titlelabel.text = @"胜负彩";
        }
            break;
        case 19:
        {
            self.imageview.image = [UIImage imageNamed:@"rengxuan9"];
            self.titlelabel.text = @"任选九";
        }
            break;
        case 63:
        {
            self.imageview.image = [UIImage imageNamed:@"pailie3"];
            self.titlelabel.text = @"排列3";
        }
            break;
        case 64:
        {
            self.imageview.image = [UIImage imageNamed:@"paile5"];
            self.titlelabel.text = @"排列5";
        }
            break;
        case 3:
        {
            self.imageview.image = [UIImage imageNamed:@"qixingcai"];
            self.titlelabel.text = @"七星彩";
        }
            break;
        case 66:
        {
            self.imageview.image = [UIImage imageNamed:@"1"];
            self.titlelabel.text = @"蒙古快3";
        }
            break;
        case 96:
        {
            self.imageview.image = [UIImage imageNamed:@"liuhecai"];
            self.titlelabel.text = @"六合彩";
        }
            break;
        case 2:
        {
            self.imageview.image = [UIImage imageNamed:@"4changjinqiu"];
            self.titlelabel.text = @"四场进球彩";
        }
            break;
        default:
        {
            self.imageview.image = nil;
            self.titlelabel.text = @"暂时无图";
        }
            break;
    }
}



@end
